<?php
session_start();
require_once( "../includes/config.php");
include  $rootPath."includes/global.php";
include $rootPath."lib/xtpl.php";
include $rootPath."classes/db.php";
include $rootPath."classes/gui.php";
////////////////
$DB = new DBCLASS();
///////////////
$id = '37';
$countsql="SELECT COUNT(*) FROM {$DP}dynamic_pages WHERE dc_id = '".$id."'";

$rs= mysql_query($countsql);
$countrow=mysql_fetch_array($rs);
$count=$countrow[0];
if ($count > 0){
	
	$sql="SELECT * FROM ".$DP."dynamic_pages WHERE dc_id = '".$id."' ORDER BY dp_id DESC LIMIT 0,4";
	$rs=mysql_query($sql);
	$string='<table width="100%" border="0" cellspacing="0" cellpadding="0" >';
	while($row=mysql_fetch_assoc($rs)){
		//--
		$cate_path_1 = $DB->GetFieldValue('dynamic_cates', $id, 'mc_id');
		$cate_path_2 = $DB->GetFieldValue('admin_cate', $cate_path_1, 'parent_id');
		//--
		$string .= '
					<tr>
						<td>
							<table height="46" border="0" width="100%" cellpadding="0" cellspacing="0">
								<tr>
									<td width="25">
										<table border="0" width="100%" cellpadding="0" cellspacing="0">
											<tr>
												<td height="20" background="'.$base_url.'templates/layout/images/vg_cauhoi.gif">&nbsp;</td>
											</tr>
											<tr>
												<td align="left">&nbsp;</td>
											</tr>
										</table>
									</td>
									<td align="left"><a href="../list-'.$cate_path_2.'_'.$cate_path_1.'-'.$id.'-'.$row['dp_id'].'.html" class="rolling_block" target="_top" title="'.$row['dp_title'].'">'.stripslashes($row['dp_title']).'</a></td>
								</tr>
							</table>
						</td>
					</tr>		
		          ';

	}
	$string .= '
				<tr>
					<td align="right" style="padding-right:10px"><a href="../list-129_164-37.html" style="color:#C33B5A;text-decoration:none" target="_top" title="Nha Khoa Bao Minh :: Câu hỏi thường gặp">Đọc thêm...</a></td>
				</tr>
	        </table>';
}
else{
	$string='<div id="datacontainer" style="position:absolute;left:1px;top:10px;width:100%" onMouseover="scrollspeed=0" onMouseout="scrollspeed=cache" class="story">Không tìm thấy bản ghi</div>';
}
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Online Fire Safety Training :: News</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="Pragma" content="no-cache" /><meta name="ROBOTS" content="index,follow" /><meta http-equiv="Content-Language" content="en-gb" /><meta http-equiv="Content-Script-Type" content="text/javascript" /><meta name="Author" content="Pyro Game Development Ltd" />'.'<meta name="Copyright" content="www.onlinefiresafetytraining.co.uk/index.php?page=terms" />'.
						'<meta name="Distribution" content="GLOBAL" />'.
						'<meta name="doc-class" content="Nha Khoa Bao Minh" />'.
						'<meta name="doc-rights" content="Nha Khoa Bao Minh" />'.
						'<meta name="Owner" content="Nha Khoa Bao Minh" />'.
						'<meta name="Rating" content="General" />'.
						'<meta name="revisit-after" content="1 Days" />'.
						'<meta name="resource-type" content="document" />'.
						'<link href="'.$base_url.'templates/layout/css/style.css" rel="stylesheet" type="text/css" />'.
						'<link href="../favicon.ico" type="Shortcut Icon" /></head><body style="background-color:transparent">' .$string.'</body></html>';


?>
